//
//  TTILogFileManager.m
//  DanoneEA
//
//  Created by Senela on 16/10/26.
//  Copyright © 2016年 翔傲科技. All rights reserved.
//

#import "TTILogFileManager.h"

@implementation TTILogFileManager
-(NSString *)newLogFileName
{
    NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"];
    NSString *timeStamp = [self getTimestamp];
    
    return [NSString stringWithFormat:@"%@ %@.log", appName, timeStamp];
}

-(BOOL)isLogFile:(NSString *)fileName {
    return NO;
}

-(NSString *)getTimestamp
{
    static dispatch_once_t onceToken;
    static NSDateFormatter *dateFormatter;
    dispatch_once(&onceToken, ^{
        dateFormatter = [NSDateFormatter new];
        [dateFormatter setDateFormat:@"YYYY.MM.dd-HH:mm:ss"];
    });
    
    return [dateFormatter stringFromDate:NSDate.date];
}


@end
